package com.sky;

import com.sky.entity.User;
import com.sky.mapper.User1Mapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableCaching//开启缓存管理
@EnableTransactionManagement //开启注解方式的事务管理
@Slf4j
@EnableScheduling//开启定时任务
public class SkyApplication {

    static {
        System.setProperty("druid.mysql.usePingMethod","false");
    }
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SkyApplication.class, args);
        User1Mapper s = context.getBean(User1Mapper.class);
        s.insertUser(new User());
        log.info("server started");
    }
}
